package com.example.task1.ui.AllService.word;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.example.task1.R;
import com.example.task1.bean.WordJobBean;
import com.example.task1.ui.BaseAdapter;

import java.util.ArrayList;
import java.util.List;

public class WordJobAdapter extends FragmentPagerAdapter {

    private List<WordJobBean.RowsDTO> data;

    public WordJobAdapter(@NonNull FragmentManager fm,List<WordJobBean.RowsDTO> rows) {
        super(fm);
        data = rows;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return new WordBaseJobFragment().newInstance(data.get(position).getId()+"","");
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return data.get(position).getProfessionName();
    }
}
